
<h3 class="forum_title" id="<?= $info['id'] ?>"> <?= $info['name']?> </h3>

<table border="0" class="forum">
	<tr>
		<th>Thread</th>
		<th>Latest Post</th>
		{admin}
		<th>
			<?= anchor('forum/admin/delete/'.$info['id'].'/'.$info['parent_id'], 'Delete', array('class' => 'admin'))?>
		</th>
		{/admin}
	</tr>

	<? foreach($this->Topic->get_topics($info['id']) as $topic): ?>
	
	<? if ($topic == -1): ?>
	
	<td colspan={admin}"3"{/admin}{not_admin}"2"{/not_admin} style="width: 50em; padding: 1em">
		There are no threads in this forum.
		{user}You can be the first to <?= anchor('topic/add/'.$info['id'], 'create one') ?>.{/user}
	</td>
	
	<? else: ?>
	<? $newest = $this->Post->get_newest($topic['id']) ?>

	<tr class="single_thread">

		<td class="name" valign="top"><?= anchor('topic/view/'.$topic['id'], $topic['name']) ?></td>
		
		<td class="latest" {not_admin}style="width: 27.5em"{/not_admin}>
			Newest: <?= anchor('topic/view/'.$newest['parent_id'], mdate('%d %F %h:%i %A', gmt_to_local($newest['created'], $this->_user['timezone'], $this->_user['daylight_savings'])) ) ?>
			<br/>
			By: <?= anchor('member/profile/view/'.$newest['user_id'], $newest['username']) ?>
		</td>

		{admin}
		<td class="delete"><?= anchor('topic/admin/delete/'.$topic['id'].'/'.$info['id'], 'X', array('class' => 'admin delete_confirm'))?></td>
		{/admin}
	</tr>
	<? endif; ?>
	<? endforeach; ?>
</table>
{user}
<?= anchor('topic/add/'.$info['id'], 'New thread') ?>
{/user}

{admin_box}
{/admin_box}